package com.woniu.mapper;

import com.woniu.pojo.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lqg
 * @since 2022-10-12
 */
public interface RoadMapper extends BaseMapper<Road> {

    /**
     * 根据 巡检员姓名 查询 巡检员id
     * @param patrolName 巡检员姓名
     * @return 巡检员id list集合
     */
    List<Long> selectPatrolIdsByPatrolName(String patrolName);

    /**
     * 根据 巡检员id 查询 路段id
     * @param patrolId 巡检员id
     * @return 路段id list集合
     */
    List<Long> selectRoadIdsByPatrolId(Long patrolId);

    List<String> selectPatrolsNameByRoadId(Long id);

    List<String> selectMaintainersNameByRoadId(Long id);

    int insertPatrolAndRoad(RoadPatrol roadPatrol);

    int insertMaintainerAndRoad(RoadMaintainer roadMaintainer);

    List<Long> selectPatrolsByRoadId(Long id);

    List<Long> selectMaintainersByRoadId(Long id);
}
